/*
 * Copyright 1999-2004 Alibaba.com All right reserved. This software is the confidential and proprietary information of
 * Alibaba.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the license agreement you entered into with Alibaba.com.
 */
package action.expr.ast;

import action.expr.ActionVisitor;
import action.expr.VisitableAction;

/**
 * �Զ����������һ�ֶ���������
 * 
 * @author pf-miles 2011-6-17 ����04:03:51
 */
public class CustomOp implements VisitableAction, OpLevel2 {

    private String key;

    public void accept(ActionVisitor visitor, Object... params) {
        visitor.visitCustomOp(this, params);
    }

    public String toString() {
        return key;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((key == null) ? 0 : key.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        CustomOp other = (CustomOp) obj;
        if (key == null) {
            if (other.key != null)
                return false;
        } else if (!key.equals(other.key))
            return false;
        return true;
    }
}
